import Vue from 'vue'
import VueRouter from 'vue-router'
import Register from '../views/Register.vue'


Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    redirect: '/login'
  },
  {
    path: '/register',
    name: 'register',
    component: Register
  },
  {
    path: '/login',
    name: 'login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/Login.vue')
  },
  {
    path: '/index',
    name: 'index',
    component: () => import( '../views/Index.vue')
  },
  {
    path: '/batnav',
    name: 'Batnav',
    component: () => import( '../views/Batnav.vue'),
    children:[
      {
        path: 'index',
        name: 'index',
        component: () => import( '../views/Index.vue')
      },
      {
        path: 'fenleilist',
        name: 'fenleilist',
        component: () => import( '../views/Fenleilist.vue')
      },
      {
        path: 'search',
        name: 'search',
        component: () => import( '../views/Search.vue')
      },
      {
        path: 'gshop',
        name: 'gshop',
        meta:{
          requireau:true,
        },
        component: () => import( '../views/Gshop.vue')
      },
      {
        path: 'my',
        name: 'my',
        meta:{
          requireau:true,
        },
        component: () => import( '../views/My.vue')
      },
      {
        path: 'shopcler',
        name: 'shopcler',
        meta:{
          requireau:true,
        },
        component: () => import( '../views/Shopcler.vue')
      }

    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
